package cate.game.play.skill.passive.hero;

import cate.game.play.buff.Buff;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.ActionCtx;
import cate.game.play.skill.passive.PassiveHandler;

/**
 * 结界消失后，队伍全体恢复施法者攻击力105%的生命值
 */
public class 月漫成双PH extends PassiveHandler {

	private String buff标签;

	private double 恢复系数;

	//buff标签=福祸与共&恢复系数=10500
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		buff标签 = args.get("buff标签");
		恢复系数 = args.getWDouble("恢复系数", 0d);
	}

	@Override
	public void onCastBuffInvalid(ActionCtx action, byte invalidReason, Buff otherBuff) {
		if (!otherBuff.cfg.containTag(buff标签)) {
			return;
		}
		if (恢复系数 > 0) {
			otherBuff.owner.attr.passiveHeal(action, skill.owner, skill.owner.attr.attTotal() * 恢复系数);
		}
	}
}
